package com.myzl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备类型
 *
 * @author myzl
 */
@Getter
@AllArgsConstructor
public enum DeviceProtocolEnum {

    MODBUS(1),
    JSON(2),
    LIDAR(3),
    WEBSOCKET(4),
    STRING(5),
    TEST(9)
    ;

    private final int code;

    public static DeviceProtocolEnum getValue(int value){
        for(DeviceProtocolEnum x:values()){
            if(x.getCode()==value){
                return x;
            }
        }
        return null;
    }

}
